package com.nativetalk.dto.weike;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.nativetalk.common.util.StringUtil;

import java.io.Serializable;

/**
 * Created by Peter on 2017/4/13.
 */
public class Weike implements Serializable {

    private Long id;//                   bigint not null auto_increment,
    private String title;//                varchar(128) comment '标题',
    private String intro;//                varchar(255) comment '介绍',
    private String cover_url;//            varchar(512) comment '封面图片',

    @JsonIgnore
    private String title_student;//                varchar(128) comment '标题', 学生端显示用的
    @JsonIgnore
    private String intro_student;//                varchar(255) comment '介绍', 学生端显示用的
    @JsonIgnore
    private String cover_url_student;//            varchar(512) comment '封面图片', 学生端显示用的

    private Double student_price;//      float default 0 comment '学生购买价格',
    private Integer buy_number;//int comment '购买人数',//界面上和人数相关的都用此字段：学习人数，收听人数，购买人数等
    private Double score;//  float comment '综合评分',


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        if (StringUtil.isBlank(this.title_student)) {
            return title;
        } else {
            return this.title_student;
        }
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getIntro() {
        if (StringUtil.isBlank(this.intro_student)) {
            return intro;
        } else {
            return this.intro_student;
        }
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public String getCover_url() {
        if (StringUtil.isBlank(this.cover_url_student)) {
            return cover_url;
        } else {
            return this.cover_url_student;
        }
    }

    public void setCover_url(String cover_url) {
        this.cover_url = cover_url;
    }

    public String getTitle_student() {
        return title_student;
    }

    public void setTitle_student(String title_student) {
        this.title_student = title_student;
    }

    public String getIntro_student() {
        return intro_student;
    }

    public void setIntro_student(String intro_student) {
        this.intro_student = intro_student;
    }

    public String getCover_url_student() {
        return cover_url_student;
    }

    public void setCover_url_student(String cover_url_student) {
        this.cover_url_student = cover_url_student;
    }

    public Double getStudent_price() {
        return student_price;
    }

    public void setStudent_price(Double student_price) {
        this.student_price = student_price;
    }

    public Integer getBuy_number() {
        return buy_number;
    }

    public void setBuy_number(Integer buy_number) {
        this.buy_number = buy_number;
    }

    public Double getScore() {
        return score;
    }

    public void setScore(Double score) {
        this.score = score;
    }


}
